﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MemberUser/MemberMaster.Master" AutoEventWireup="true" CodeBehind="ChgUserPhoto.aspx.cs" Inherits="ZLCMS.Web.MemberUser.ChgUserPhoto" %>

<%@ Import Namespace="ZLCMS.Business.Util" %>
<%@ MasterType VirtualPath="~/MemberUser/MemberMaster.Master" %>
<%@ Register Src="UC/MemberCategory.ascx" TagName="MemberCategory" TagPrefix="uc1" %>
<%@ Register Src="UC/Ad_Right.ascx" TagName="Ad_Right" TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<%--<script src="http://open.web.meitu.com/sources/xiuxiu.js" type="text/javascript"></script>--%>
<script src="/MemberUser/js/meituxiuxiu.js" type="text/javascript"></script>
<script type="text/javascript">
    window.onload = function () {
        xiuxiu.embedSWF("altContent", 5, "650px", "400px");
        /*第1个参数是加载编辑器div容器，第2个参数是编辑器类型，第3个参数是div容器宽，第4个参数是div容器高*/
        xiuxiu.setUploadType(2);
        xiuxiu.setUploadURL('<%= ZLCMS.Business.Util.ServerUtil.GetRootURI() + "/Interface/post.ashx?user="+ System.Web.Security.FormsAuthentication.Encrypt((Page.User.Identity as FormsIdentity).Ticket) %>'); 
        //修改为上传接收图片程序地址
        xiuxiu.onInit = function () {
            xiuxiu.loadPhoto("http://open.web.meitu.com/sources/images/1.jpg"); //修改为要处理的图片url
        }
        xiuxiu.onUploadResponse = function (data) {
            var fileObj = eval('(' + data + ')');
           $("#img_user").attr("src", fileObj.FilePath);
           
            //            $("#p_img_url").html(data);
           $("#<%=hid_img.ClientID %>").val("[" + data + "]");
            $("#div_form").css("display", "block");
            $("#div_meitu").css("display", "none");
        }

    }
    function ShowMeituCt() {
        $("#div_form").css("display", "none");
        $("#div_meitu").css("display", "block");
        
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div id="wrapper">
        <!--left start-->
        <div class="shop_left">
            <uc1:MemberCategory ID="MemberCategory1" runat="server" />
        </div>
        <!--left end-->
        <!--centent start-->
        <div class="shop_centent">
            <h2>
                修改头像</h2>
            <div class="box">
                <div class="regist_box no_bxd" style="padding:10px 10px;">
                    <div class="r_left">
                        <div class="tabs_box">
                            <div class="con1" id="div_form">
                                <form id="Form1" runat="Server" class="registerform">
                                <div class="inp">
                                  <img id="img_user" src='<%= FileKit.FirstFilePath( _memberDb.PhotoUrl as string)%>' style="width:150px;height:180px" />
                                </div>
                                <div style="margin-top:5px;">&nbsp;&nbsp;&nbsp;<input type="button" value="上传" id="btn_upload" onclick="ShowMeituCt()" /><div id="p_img_url"></div>  </div>
                                
                                    <p class="tijiao">
                                     <input type="hidden" id="hid_img"  value=''  runat="server" />
                                     <asp:Button ID="Button1" class="submit" runat="server" Text="确认修改" OnClick="Button1_Click" /> </p>
                                </form>
                                 
                                </div>
                                <div id="div_meitu" style="display:none;">
                                <div id="altContent">
	                                <h1>美图秀秀</h1>
                                </div>
                                </div>
                           
                        </div>
                    </div>
                    <div class="clear">
                    </div>
                </div>
            </div>
        </div>
        <!--centent end-->
        <!--right start-->
        <div class="shop_right">
            <uc2:Ad_Right ID="Ad_Right1" runat="server" />
        </div>
        <!--right end-->
        <div class="clear">
        </div>
    </div>
</asp:Content>
